class UserData {
  String? tip;
  Anchor? anchor;
  Userinfo? userinfo;
  Usercount? usercount;

  UserData({tip, anchor, userinfo, usercount});

  UserData.fromJson(Map<String, dynamic> json) {
    tip = json['tip'];
    anchor = json['anchor'] != null ? Anchor.fromJson(json['anchor']) : null;
    userinfo =
        json['userinfo'] != null ? Userinfo.fromJson(json['userinfo']) : null;
    usercount = json['usercount'] != null
        ? Usercount.fromJson(json['usercount'])
        : null;
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = <String, dynamic>{};
    data['tip'] = tip;
    if (anchor != null) {
      data['anchor'] = anchor!.toJson();
    }
    if (userinfo != null) {
      data['userinfo'] = userinfo!.toJson();
    }
    if (usercount != null) {
      data['usercount'] = usercount!.toJson();
    }
    return data;
  }
}

class Anchor {
  int? openVideoStatus;
  int? orderSwitch;
  int? hideGiftStatus;
  int? hideGuardStatus;
  int? hideRankStatus;

  Anchor(
      {openVideoStatus,
      orderSwitch,
      hideGiftStatus,
      hideGuardStatus,
      hideRankStatus});

  Anchor.fromJson(Map<String, dynamic> json) {
    openVideoStatus = json['open_video_status'];
    orderSwitch = json['order_switch'];
    hideGiftStatus = json['hide_gift_status'];
    hideGuardStatus = json['hide_guard_status'];
    hideRankStatus = json['hide_rank_status'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = <String, dynamic>{};
    data['open_video_status'] = openVideoStatus;
    data['order_switch'] = orderSwitch;
    data['hide_gift_status'] = hideGiftStatus;
    data['hide_guard_status'] = hideGuardStatus;
    data['hide_rank_status'] = hideRankStatus;
    return data;
  }
}

class Userinfo {
  String? usercode;
  String? nickname;
  int? type;
  String? mobile;
  String? avatar;
  int? gender;
  int? age;
  String? birthday;
  String? city;
  int? finishStatus;
  int? createtime;
  String? imToken;
  int? isAnchor;
  int? openVideoStatus;
  int? canWithdraw;
  int? userId;
  String? token;
  int? expiretime;
  int? expiresIn;
  List<String>? albumList;
  int? vip;
  int? vipLevel;
  String? tag;
  String? dateline;
  int? openMsgStatus;
  int? muteStatus;

  Userinfo(
      {usercode,
      nickname,
      type,
      mobile,
      avatar,
      gender,
      age,
      birthday,
      city,
      finishStatus,
      createtime,
      imToken,
      isAnchor,
      openVideoStatus,
      canWithdraw,
      userId,
      token,
      expiretime,
      expiresIn,
      albumList,
      vip,
      vipLevel,
      tag,
      dateline,
      openMsgStatus,
      muteStatus});

  Userinfo.fromJson(Map<String, dynamic> json) {
    usercode = json['usercode'];
    nickname = json['nickname'];
    type = json['type'];
    mobile = json['mobile'];
    avatar = json['avatar'];
    gender = json['gender'];
    age = json['age'];
    birthday = json['birthday'];
    city = json['city'];
    finishStatus = json['finish_status'];
    createtime = json['createtime'];
    imToken = json['im_token'];
    isAnchor = json['is_anchor'];
    openVideoStatus = json['open_video_status'];
    canWithdraw = json['can_withdraw'];
    userId = json['user_id'];
    token = json['token'];
    expiretime = json['expiretime'];
    expiresIn = json['expires_in'];
    if (json['album_list'] != null) {
      albumList = json['album_list'].cast<String>();
    } else {
      albumList = [];
    }
    vip = json['vip'];
    vipLevel = json['vip_level'];
    tag = json['tag'];
    dateline = json['dateline'];
    openMsgStatus = json['open_msg_status'];
    muteStatus = json['mute_status'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = <String, dynamic>{};
    data['usercode'] = usercode;
    data['nickname'] = nickname;
    data['type'] = type;
    data['mobile'] = mobile;
    data['avatar'] = avatar;
    data['gender'] = gender;
    data['age'] = age;
    data['birthday'] = birthday;
    data['city'] = city;
    data['finish_status'] = finishStatus;
    data['createtime'] = createtime;
    data['im_token'] = imToken;
    data['is_anchor'] = isAnchor;
    data['open_video_status'] = openVideoStatus;
    data['can_withdraw'] = canWithdraw;
    data['user_id'] = userId;
    data['token'] = token;
    data['expiretime'] = expiretime;
    data['expires_in'] = expiresIn;
    data['album_list'] = albumList;
    data['vip'] = vip;
    data['vip_level'] = vipLevel;
    data['tag'] = tag;
    data['dateline'] = dateline;
    data['open_msg_status'] = openMsgStatus;
    data['mute_status'] = muteStatus;
    return data;
  }
}

class Usercount {
  int? fansCount;
  int? newFansCount;
  int? followCount;
  int? visitorCount;
  int? newVisitorCount;
  int? viewerCount;

  Usercount(
      {fansCount,
      newFansCount,
      followCount,
      visitorCount,
      newVisitorCount,
      viewerCount});

  Usercount.fromJson(Map<String, dynamic> json) {
    fansCount = json['fans_count'];
    newFansCount = json['new_fans_count'];
    followCount = json['follow_count'];
    visitorCount = json['visitor_count'];
    newVisitorCount = json['new_visitor_count'];
    viewerCount = json['viewer_count'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = <String, dynamic>{};
    data['fans_count'] = fansCount;
    data['new_fans_count'] = newFansCount;
    data['follow_count'] = followCount;
    data['visitor_count'] = visitorCount;
    data['new_visitor_count'] = newVisitorCount;
    data['viewer_count'] = viewerCount;
    return data;
  }
}
